if(NOT TARGET protobuf)
    include(FindProtobuf)
    find_package(Protobuf REQUIRED)
    set(Protobuf_USE_STATIC_LIBS ON)
    include_directories(${PROTOBUF_INCLUDE_DIR})
    include_directories(${CMAKE_CURRENT_SOURCE_DIR})
    set(PROTOBUF_LIBRARIES ${PROTOBUF_LIBRARIES} CACHE INTERNAL "" FORCE)
endif()

PROTOBUF_GENERATE_CPP(PROTO_SRC PROTO_HEADER p2o_paddle.proto)
add_library(p2o_paddle_proto ${PROTO_HEADER} ${PROTO_SRC})
